package mo.leetcode_top;

public class L268 {

    public int missingNumber(int[] nums) {
        int n = nums.length + 1;
        int total = n * (n-1) / 2;
        for (int i = 0; i < nums.length; i++) {
            total -= nums[i];
        }
        return total;
    }

}
